﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;

namespace Web
{
    public class Helper:System.Web.UI.Page
    {
        public void ShowFlashMessage(Label FlashMessageLabel)
        {
            string flashMessage = Session["FlashMessage"] as string;
            if (flashMessage != null)
            {
                FlashMessageLabel.Text = flashMessage;
                FlashMessageLabel.CssClass = (Session["FlashMessageType"] as string) ?? "notice";
                Session["FlashMessage"] = null;
                Session["FlashMessageType"] = null;
            }
            else
            {
                FlashMessageLabel.Text = "";
                FlashMessageLabel.CssClass = null;
                Session["FlashMessage"] = null;
                Session["FlashMessageType"] = null;
            }
        }
    }
}